import { createRouter, createWebHistory } from "vue-router";
import Purposes from "../purposes/Purposes.vue";
import MaterialsFixed from "../purposes/MaterialsFixed.vue";
import Material from "../purposes/Material.vue";
import index from "../purposes/index.vue";
import Text from "../purposes/Text.vue";
import Demo from "../purposes/Demo.vue";
import DemoText from "../purposes/DemoText.vue";
import AssistDemand from "../purposes/AssistDemand.vue";
import AssistMaterialDetails from "../purposes/AssistMaterialDetails.vue";
import AssistDosage from "../purposes/AssistDosage.vue";
import Home from "../purposes/Home.vue";
import Navigation from "../views/Navigation.vue";
import CS from "../purposes/CS.vue";
import Cookies from "js-cookie";
import UserInformation from "../purposes/admin/UserInformation.vue";
import RoleInformation from "../purposes/admin/RoleInformation.vue";
import MenuMaintenance from "../purposes/admin/MenuMaintenance.vue";
import ButtonInformation from "../purposes/admin/ButtonInformation.vue";
import MaterialQuality from "../purposes/MaterialQuality.vue";
// 磨床
import K3wh from "../views/mc/K3wh.vue";
import Test from "../views/mc/Test.vue";
import XXX from "../views/mc/XXX.vue";
import Dejz from "../views/mc/Dejz.vue";
import MoXiao from "../views/mc/MoXiao.vue";
import Hc from "../views/mc/Hc.vue";
import Abnormal from "../views/mc/Abnormal.vue";
import SearchTableDialog from "../components/dialogs/SearchTableDialog.vue";
import Test1 from "../views/mc/Test1.vue";
import Test2 from "../views/mc/Test2.vue";
import SysParameters from "../views/mc/SysParameters.vue";
import SysStatus from "../views/mc/SysStatus.vue";
import DataStructure from "../views/mc/DataStructure.vue";
// 基础信息
import BusinessType from "../views/PartsManagement/BusinessType.vue";
import TeamManagement from "../views/PartsManagement/TeamManagement.vue";
import BusinessFy from "../views/fY/BusinessFy.vue";
import ComponentItemClassification from "../views/PartsManagement/ComponentItemClassification.vue";
import BusinessDepartmentType from "../views/PartsManagement/BusinessDepartmentType.vue";
import BusinessProjectTypeMapping from "../views/PartsManagement/BusinessProjectTypeMapping.vue";
import EquipmentBasicInfo from "../views/PartsManagement/EquipmentBasicInfo.vue";

import BusinessMatter from "../views/fY/BusinessMatterClassification.vue";
import BusinessMatterBasic from "../views/fY/BusinessMatterBasicInfo.vue";
import ComponentCategory from "../views/ComponentMechanical/ComponentCategory.vue";
import ParameterClassification from "../views/PartsManagement/ParameterClassification.vue";
import ParameterItemTable from "../views/PartsManagement/ParameterItemTable.vue";
import BusinessProjectParameterItemMapping from "../views/PartsManagement/BusinessProjectParameterItemMapping.vue";
import ComponentSingleRegistrationTable from "../views/PartsManagement/ComponentSingleRegistrationTable.vue";
import SingleRegistrationTable from "../views/ComponentMechanical/SingleRegistrationTable.vue";
import SingleRegistration from "../views/ComponentMechanical/SingleRegistration.vue";
// 设备结构
import EquipmentStructure from "../views/Equipment/EquipmentStructure.vue";
import BusinessDimensionConfiguration from "../views/Equipment/BusinessDimensionConfiguration.vue";
import ComponentGroupSetting from "../views/Equipment/ComponentGroupSetting.vue";
import ComponentGroupUpdate from "../views/Equipment/ComponentGroupUpdate.vue";
import Equipmentoperation from "../views/Equipment/Equipmentoperation.vue";
import EqDemo from "../views/Equipment/EqDemo.vue";
//工艺标准
import GrindingProcessStandard from "../views/ProcessStandard/GrindingProcessStandard.vue";
import ReplaceProcessStandards from "../views/ProcessStandard/ReplaceProcessStandards.vue";
import ProductRollerRoughnessSettingMainController from "../views/ProcessStandard/ProductRollerRoughnessSettingMainController.vue";
import PartSingleRegister from "../views/EM/partRegt/PartSingleRegister.vue";
import WorkOrderPlan from "../views/ComponentMechanical/WorkOrderPlan.vue";
import GrindingWorkOrder from "../views/Equipment/GrindingWorkOrder.vue";
import ComponentSingleStatus from "../views/ComponentMechanical/ComponentSingleStatus.vue";
import OutsourcingResult from "../views/ComponentMechanical/OutsourcingResult.vue";
import OutsourcingStorage from "../views/ComponentMechanical/OutsourcingStorage.vue";

//异常/委外
import RepairApplication from "../views/ComponentMechanical/RepairApplication.vue";
import AbnormalApplication from "../views/ComponentMechanical/AbnormalApplication.vue";
import RepairOutsourcing from "../views/ComponentMechanical/RepairOutsourcing.vue";
//报表
import ItemReport from "../views/Report/ItemReport.vue";
import ItemReportDemo from "../views/Report/ItemReportDemo.vue";
import PartsListReport from "../views/Report/PartsListReport.vue";
import ComponentSingleReport from "../views/Report/ComponentSingleReport.vue";
//EM
import Send_back_t from "../views/EM/partRegt/Send_back_t.vue";
import SendBack from "../views/EM/partRegt/SendBack.vue";
import PartSingleInfo from "../views/EM/partRegt/PartSingleInfo.vue";
import PartSingleAlterInfo from "../views/EM/partRegt/PartSingleAlterInfo.vue";
import BaseRackAlter from "../views/EM/partRegt/BaseRackAlter.vue"; //料架变更

//wo_manage
import WOPlan from "../views/EM/wo_manage/WOPlan.vue";
import WoPalnDemo from "../views/EM/wo_manage/WoPalnDemo.vue";
import WoPlanInstall from "../views/EM/wo_manage/WoPlanInstall.vue";
import WoReportInstall from "../views/EM/wo_manage/WoReportInstall.vue";
import WoPlanUninstall from "../views/EM/wo_manage/WoPlanUninstall.vue";
import WoReportUninsta from "../views/EM/wo_manage/WoReportUninsta.vue";
import WOPlanGrind from "../views/EM/wo_manage/WOPlanGrind.vue";
import GrindRequest from "../views/EM/wo_manage/GrindRequest.vue";
import WOReportGrind from "../views/EM/wo_manage/WOReportGrind.vue";
import WoPlanGpd from "../views/EM/wo_manage/WoPlanGpd.vue";
import BaseRack from "../views/EM/basic/BaseRack.vue"; //放料架
import BasePartGroup from "../views/EM/basic/BasePartGroup.vue"; //零件编组
import WOTeamDuty from "../views/EM/wo_manage/WOTeamDuty.vue"; //班组签到

//维修
import RepairRequestInfo from "../views/EM/wo_manage/RepairRequestInfo.vue";
import RepairOutInfo from "../views/EM/wo_manage/RepairOutInfo.vue";
import RepairArrivalInfo from "../views/EM/wo_manage/RepairArrivalInfo.vue";

//委外 entrust
import EntrustRequest from "../views/EM/entrust/EntrustRequest.vue";
import EntrustOut from "../views/EM/entrust/EntrustOut.vue";
import EntrustArrival from "../views/EM/entrust/EntrustArrival.vue";
//异常
import NGRequest from "../views/EM/ng/NGRequest.vue";
import NGJudge from "../views/EM/ng/NGJudge.vue";
import NGSign from "../views/EM/ng/NGSign.vue";
import NGReviewPerson from "../views/EM/ng/NGReviewPerson.vue";
//报表
import PcbReport from "../views/EM/report/PcbReport.vue";
import PshoReport from "../views/EM/report/PshoReport.vue";
import PsrReport from "../views/EM/report/PsrReport.vue";
import GrindPoolFinish from "../views/EM/report/GrindPoolFinish.vue";
import GrindPool from "../views/EM/report/GrindPool.vue";
//工具
import QrCodeGeneration from "../views/EM/tool/QrCodeGeneration.vue";
//出售
import ScrapCharged from "../views/EM/sell/ScrapCharged.vue";
import ScrappedSale from "../views/EM/sell/ScrappedSale.vue";
//工单管理
import ProcessFlow from "../views/Process/ProcessFlow.vue";
import ProcessReport from "../views/Process/ProcessReport.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "index",
      component: index,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/846495F9CEED11ACCF8879F555936A7D",
      name: "846495F9CEED11ACCF8879F555936A7D",
      component: Navigation,
      meta: {
        keepAlive: true,
      },
    },

    {
      path: "/UserInformation",
      name: "UserInformation",
      component: UserInformation,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ButtonInformation",
      name: "ButtonInformation",
      component: ButtonInformation,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/MenuMaintenance",
      name: "MenuMaintenance",
      component: MenuMaintenance,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/RoleInformation",
      name: "RoleInformation",
      component: RoleInformation,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/Home",
      name: "Home",
      component: Home,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/Purposes",
      name: "Purposes",
      component: Purposes,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/AssistDosage",
      name: "AssistDosage",
      component: AssistDosage,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/Material",
      name: "Material",
      component: Material,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/MaterialsFixed",
      name: "MaterialsFixed",
      component: MaterialsFixed,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/AssistDemand",
      name: "AssistDemand",
      component: AssistDemand,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/AssistMaterialDetails",
      name: "AssistMaterialDetails",
      component: AssistMaterialDetails,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/Text",
      name: "Text",
      component: Text,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/Demo",
      name: "Demo",
      component: Demo,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/DemoText",
      name: "DemoText",
      component: DemoText,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/CS",
      name: "CS",
      component: CS,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/K3wh",
      name: "K3wh",
      component: K3wh,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/Dejz",
      name: "Dejz",
      component: Dejz,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/MoXiao",
      name: "MoXiao",
      component: MoXiao,
      meta: {
        keepAlive: false,
      },
    },
    {
      path: "/Hc",
      name: "Hc",
      component: Hc,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/Abnormal",
      name: "Abnormal",
      component: Abnormal,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/Test",
      name: "Test",
      component: Test,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/XXX",
      name: "XXX",
      component: XXX,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/SearchTableDialog",
      name: "SearchTableDialog",
      component: SearchTableDialog,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/Test1",
      name: "Test1",
      component: Test1,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/Test2",
      name: "Test2",
      component: Test2,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/BusinessType",
      name: "BusinessType",
      component: BusinessType,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/TeamManagement",
      name: "TeamManagement",
      component: TeamManagement,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/SysParameters",
      name: "SysParameters",
      component: SysParameters,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/SysStatus",
      name: "SysStatus",
      component: SysStatus,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/DataStructure",
      name: "DataStructure",
      component: DataStructure,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/BusinessFy",
      name: "BusinessFy",
      component: BusinessFy,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/BusinessMatter",
      name: "BusinessMatter",
      component: BusinessMatter,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ComponentItemClassification",
      name: "ComponentItemClassification",
      component: ComponentItemClassification,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/BusinessMatterBasic",
      name: "BusinessMatterBasic",
      component: BusinessMatterBasic,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/BusinessDepartmentType",
      name: "BusinessDepartmentType",
      component: BusinessDepartmentType,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ComponentCategory",
      name: "ComponentCategory",
      component: ComponentCategory,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ParameterClassification",
      name: "ParameterClassification",
      component: ParameterClassification,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/BusinessProjectTypeMapping",
      name: "BusinessProjectTypeMapping",
      component: BusinessProjectTypeMapping,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/EquipmentBasicInfo",
      name: "EquipmentBasicInfo",
      component: EquipmentBasicInfo,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ParameterItemTable",
      name: "ParameterItemTable",
      component: ParameterItemTable,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/BusinessProjectParameterItemMapping",
      name: "BusinessProjectParameterItemMapping",
      component: BusinessProjectParameterItemMapping,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/EquipmentStructure",
      name: "EquipmentStructure",
      component: EquipmentStructure,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/BusinessDimensionConfiguration",
      name: "BusinessDimensionConfiguration",
      component: BusinessDimensionConfiguration,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/SingleRegistrationTable",
      name: "SingleRegistrationTable",
      component: SingleRegistrationTable,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ComponentSingleRegistrationTable",
      name: "ComponentSingleRegistrationTable",
      component: ComponentSingleRegistrationTable,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/SingleRegistration",
      name: "SingleRegistration",
      component: SingleRegistration,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ComponentGroupSetting",
      name: "ComponentGroupSetting",
      component: ComponentGroupSetting,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ComponentGroupUpdate",
      name: "ComponentGroupUpdate",
      component: ComponentGroupUpdate,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/GrindingProcessStandard",
      name: "GrindingProcessStandard",
      component: GrindingProcessStandard,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ComponentSingleStatus",
      name: "ComponentSingleStatus",
      component: ComponentSingleStatus,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/Equipmentoperation",
      name: "Equipmentoperation",
      component: Equipmentoperation,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/WorkOrderPlan",
      name: "WorkOrderPlan",
      component: WorkOrderPlan,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/PartSingleRegister",
      name: "PartSingleRegister",
      component: PartSingleRegister,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/GrindingWorkOrder",
      name: "GrindingWorkOrder",
      component: GrindingWorkOrder,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/OutsourcingResult",
      name: "OutsourcingResult",
      component: OutsourcingResult,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/OutsourcingStorage",
      name: "OutsourcingStorage",
      component: OutsourcingStorage,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/AbnormalApplication",
      name: "AbnormalApplication",
      component: AbnormalApplication,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/RepairApplication",
      name: "RepairApplication",
      component: RepairApplication,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/RepairOutsourcing",
      name: "RepairOutsourcing",
      component: RepairOutsourcing,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/EqDemo",
      name: "EqDemo",
      component: EqDemo,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/MaterialQuality",
      name: "MaterialQuality",
      component: MaterialQuality,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ReplaceProcessStandards",
      name: "ReplaceProcessStandards",
      component: ReplaceProcessStandards,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ProductRollerRoughnessSettingMainController",
      name: "ProductRollerRoughnessSettingMainController",
      component: ProductRollerRoughnessSettingMainController,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ItemReport",
      name: "ItemReport",
      component: ItemReport,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ItemReportDemo",
      name: "ItemReportDemo",
      component: ItemReportDemo,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/PartsListReport",
      name: "PartsListReport",
      component: PartsListReport,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/PartsListReport",
      name: "PartsListReport",
      component: PartsListReport,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ComponentSingleReport",
      name: "ComponentSingleReport",
      component: ComponentSingleReport,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/Send_back_t",
      name: "Send_back_t",
      component: Send_back_t,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/SendBack",
      name: "SendBack",
      component: SendBack,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/PartSingleInfo",
      name: "PartSingleInfo",
      component: PartSingleInfo,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/PartSingleAlterInfo",
      name: "PartSingleAlterInfo",
      component: PartSingleAlterInfo,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/BaseRackAlter",
      name: "BaseRackAlter",
      component: BaseRackAlter,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/WOPlan",
      name: "WOPlan",
      component: WOPlan,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/WoPalnDemo",
      name: "WoPalnDemo",
      component: WoPalnDemo,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/WoPlanInstall",
      name: "WoPlanInstall",
      component: WoPlanInstall,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/WoReportInstall",
      name: "WoReportInstall",
      component: WoReportInstall,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/WoPlanUninstall",
      name: "WoPlanUninstall",
      component: WoPlanUninstall,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/WoReportUninsta",
      name: "WoReportUninsta",
      component: WoReportUninsta,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/WOPlanGrind",
      name: "WOPlanGrind",
      component: WOPlanGrind,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/GrindRequest",
      name: "GrindRequest",
      component: GrindRequest,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/WOReportGrind",
      name: "WOReportGrind",
      component: WOReportGrind,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/EntrustRequest",
      name: "EntrustRequest",
      component: EntrustRequest,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/EntrustOut",
      name: "EntrustOut",
      component: EntrustOut,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/EntrustArrival",
      name: "EntrustArrival",
      component: EntrustArrival,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/NGRequest",
      name: "NGRequest",
      component: NGRequest,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/NGJudge",
      name: "NGJudge",
      component: NGJudge,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/NGSign",
      name: "NGSign",
      component: NGSign,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/NGReviewPerson",
      name: "NGReviewPerson",
      component: NGReviewPerson,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/RepairRequestInfo",
      name: "RepairRequestInfo",
      component: RepairRequestInfo,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/RepairOutInfo",
      name: "RepairOutInfo",
      component: RepairOutInfo,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/RepairArrivalInfo",
      name: "RepairArrivalInfo",
      component: RepairArrivalInfo,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/PcbReport",
      name: "PcbReport",
      component: PcbReport,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/PshoReport",
      name: "PshoReport",
      component: PshoReport,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/PsrReport",
      name: "PsrReport",
      component: PsrReport,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/GrindPoolFinish",
      name: "GrindPoolFinish",
      component: GrindPoolFinish,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/GrindPool",
      name: "GrindPool",
      component: GrindPool,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/BaseRack",
      name: "BaseRack",
      component: BaseRack,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/BasePartGroup",
      name: "BasePartGroup",
      component: BasePartGroup,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/WoPlanGpd",
      name: "WoPlanGpd",
      component: WoPlanGpd,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/WOTeamDuty",
      name: "WOTeamDuty",
      component: WOTeamDuty,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/QrCodeGeneration",
      name: "QrCodeGeneration",
      component: QrCodeGeneration,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ScrapCharged",
      name: "ScrapCharged",
      component: ScrapCharged,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ScrappedSale",
      name: "ScrappedSale",
      component: ScrappedSale,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ProcessFlow",
      name: "ProcessFlow",
      component: ProcessFlow,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: "/ProcessReport",
      name: "ProcessReport",
      component: ProcessReport,
      meta: {
        keepAlive: true,
      },
    },

    {
      path: "/:pathMatch(.*)*",
      redirect: { name: "index" },
    },
  ],
});
// 添加全局前置守卫
router.beforeEach((to, from, next) => {
  window.document.title = "环胜";
  const link: HTMLLinkElement =
    document.querySelector("link[rel~='icon']") ||
    document.createElement("link");
  link.type = "image/x-icon"; // 设置为图标文件的 MIME 类型
  link.rel = "icon";
  link.href = "../../public/index/hs.ico";
  document.head.appendChild(link);

  // 获取存储在 Cookie 中的用户信息
  const userName = Cookies.get("userName");

  if (to.name !== "index" && !userName) {
    next({ name: "index" });
  } else {
    next();
  }
});

export default router;
